# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=evolution-ews
pkgver=3.50.2
pkgrel=0
pkgdesc="MS Exchange integration through Exchange Web Services"
url="https://wiki.gnome.org/Apps/Evolution/EWS"
arch="all !s390x !riscv64" # blocked by evolution
license="LGPL-2.1-or-later"
makedepends="
	cmake
	evolution-data-server-dev
	evolution-dev
	gettext-dev
	glib-dev
	gtk-doc
	libmspack-dev
	libsoup3-dev
	samurai
	uhttpmock-dev
	"
options="!check" # fail in docker due to port restrictions
subpackages="$pkgname-lang"
source="https://download.gnome.org/sources/evolution-ews/${pkgver%.*}/evolution-ews-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=OFF
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9aa4bb023922e39132a0ac3171d95f8362116960aa14dcb961b31ad242e6d7bcf2e946f19aea2c6f9a5324ca0954731264594a27fbb2b0e2cc38eca0cf441108  evolution-ews-3.50.2.tar.xz
"
